home *** CD-ROM | disk | FTP | other *** search
/ Languguage OS 2 / Languguage OS II Version 10-94 (Knowledge Media)(1994).ISO / gnu / doschk11.lha / doschk-1.1 / configure < prev    next >
Text File  |  1993-05-21  |  8KB  |  261 lines

  1. #!/bin/sh
  2. # Guess values for system-dependent variables and create Makefiles.
  3. # Generated automatically using autoconf.
  4. # Copyright (C) 1991, 1992, 1993 Free Software Foundation, Inc.
  5.  
  6. # This program is free software; you can redistribute it and/or modify
  7. # it under the terms of the GNU General Public License as published by
  8. # the Free Software Foundation; either version 2, or (at your option)
  9. # any later version.
  10.  
  11. # This program is distributed in the hope that it will be useful,
  12. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  14. # GNU General Public License for more details.
  15.  
  16. # You should have received a copy of the GNU General Public License
  17. # along with this program; if not, write to the Free Software
  18. # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  19.  
  20. # Usage: configure [--srcdir=DIR] [--host=HOST] [--gas] [--nfp] [--no-create]
  21. #        [--prefix=PREFIX] [--exec-prefix=PREFIX] [--with-PACKAGE] [TARGET]
  22. # Ignores all args except --srcdir, --prefix, --exec-prefix, --no-create, and
  23. # --with-PACKAGE unless this script has special code to handle it.
  24.  
  25.  
  26. for arg
  27. do
  28.   # Handle --exec-prefix with a space before the argument.
  29.   if test x$next_exec_prefix = xyes; then exec_prefix=$arg; next_exec_prefix=
  30.   # Handle --host with a space before the argument.
  31.   elif test x$next_host = xyes; then next_host=
  32.   # Handle --prefix with a space before the argument.
  33.   elif test x$next_prefix = xyes; then prefix=$arg; next_prefix=
  34.   # Handle --srcdir with a space before the argument.
  35.   elif test x$next_srcdir = xyes; then srcdir=$arg; next_srcdir=
  36.   else
  37.     case $arg in
  38.      # For backward compatibility, also recognize exact --exec_prefix.
  39.      -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* | --exec=* | --exe=* | --ex=* | --e=*)
  40.     exec_prefix=`echo $arg | sed 's/[-a-z_]*=//'` ;;
  41.      -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- | --exec | --exe | --ex | --e)
  42.     next_exec_prefix=yes ;;
  43.  
  44.      -gas | --gas | --ga | --g) ;;
  45.  
  46.      -host=* | --host=* | --hos=* | --ho=* | --h=*) ;;
  47.      -host | --host | --hos | --ho | --h)
  48.     next_host=yes ;;
  49.  
  50.      -nfp | --nfp | --nf) ;;
  51.  
  52.      -no-create | --no-create | --no-creat | --no-crea | --no-cre | --no-cr | --no-c | --no- | --no)
  53.         no_create=1 ;;
  54.  
  55.      -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
  56.     prefix=`echo $arg | sed 's/[-a-z_]*=//'` ;;
  57.      -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
  58.     next_prefix=yes ;;
  59.  
  60.      -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=* | --s=*)
  61.     srcdir=`echo $arg | sed 's/[-a-z_]*=//'` ;;
  62.      -srcdir | --srcdir | --srcdi | --srcd | --src | --sr | --s)
  63.     next_srcdir=yes ;;
  64.  
  65.      -with-* | --with-*)
  66.        package=`echo $arg|sed 's/-*with-//'`
  67.        # Delete all the valid chars; see if any are left.
  68.        if test -n "`echo $package|sed 's/[-a-zA-Z0-9_]*//g'`"; then
  69.          echo "configure: $package: invalid package name" >&2; exit 1
  70.        fi
  71.        eval "with_`echo $package|sed s/-/_/g`=1" ;;
  72.  
  73.      -v | -verbose | --verbose | --verbos | --verbo | --verb | --ver | --ve | --v)
  74.        verbose=yes ;;
  75.  
  76.      *) ;;
  77.     esac
  78.   fi
  79. done
  80.  
  81. trap 'rm -f conftest* core; exit 1' 1 3 15
  82.  
  83. rm -f conftest*
  84. compile='${CC-cc} $CFLAGS $DEFS conftest.c -o conftest $LIBS >/dev/null 2>&1'
  85.  
  86. # A filename unique to this package, relative to the directory that
  87. # configure is in, which we can look for to find out if srcdir is correct.
  88. unique_file=doschk.c
  89.  
  90. # Find the source files, if location was not specified.
  91. if test -z "$srcdir"; then
  92.   srcdirdefaulted=yes
  93.   # Try the directory containing this script, then `..'.
  94.   prog=$0
  95.   confdir=`echo $prog|sed 's%/[^/][^/]*$%%'`
  96.   test "X$confdir" = "X$prog" && confdir=.
  97.   srcdir=$confdir
  98.   if test ! -r $srcdir/$unique_file; then
  99.     srcdir=..
  100.   fi
  101. fi
  102. if test ! -r $srcdir/$unique_file; then
  103.   if test x$srcdirdefaulted = xyes; then
  104.     echo "configure: Can not find sources in \`${confdir}' or \`..'." 1>&2
  105.   else
  106.     echo "configure: Can not find sources in \`${srcdir}'." 1>&2
  107.   fi
  108.   exit 1
  109. fi
  110. # Preserve a srcdir of `.' to avoid automounter screwups with pwd.
  111. # But we can't avoid them for `..', to make subdirectories work.
  112. case $srcdir in
  113.   .|/*|~*) ;;
  114.   *) srcdir=`cd $srcdir; pwd` ;; # Make relative path absolute.
  115. esac
  116.  
  117. if test -z "$CC"; then
  118.   # Extract the first word of `gcc', so it can be a program name with args.
  119.   set dummy gcc; word=$2
  120.   echo checking for $word
  121.   IFS="${IFS=     }"; saveifs="$IFS"; IFS="${IFS}:"
  122.   for dir in $PATH; do
  123.     test -z "$dir" && dir=.
  124.     if test -f $dir/$word; then
  125.       CC="gcc"
  126.       break
  127.     fi
  128.   done
  129.   IFS="$saveifs"
  130. fi
  131. test -z "$CC" && CC="cc"
  132. test -n "$CC" -a -n "$verbose" && echo "    setting CC to $CC"
  133.  
  134. # Find out if we are using GNU C, under whatever name.
  135. cat > conftest.c <<EOF
  136. #ifdef __GNUC__
  137.   yes
  138. #endif
  139. EOF
  140. ${CC-cc} -E conftest.c > conftest.out 2>&1
  141. if egrep yes conftest.out >/dev/null 2>&1; then
  142.   GCC=1 # For later tests.
  143. fi
  144. rm -f conftest*
  145.  
  146. # Make sure to not get the incompatible SysV /etc/install and
  147. # /usr/sbin/install, which might be in PATH before a BSD-like install,
  148. # or the SunOS /usr/etc/install directory, or the AIX /bin/install,
  149. # or the AFS install, which mishandles nonexistent args, or
  150. # /usr/ucb/install on SVR4 (which tries to use the nonexistent group
  151. # `staff'.  On most BSDish systems install is in /usr/bin, not /usr/ucb
  152. # anyway).  Sigh.
  153. if test "z${INSTALL}" = "z" ; then
  154.   echo checking for install
  155.   IFS="${IFS=     }"; saveifs="$IFS"; IFS="${IFS}:"
  156.   for dir in $PATH; do
  157.     test -z "$dir" && dir=.
  158.     case $dir in
  159.     /etc|/usr/sbin|/usr/etc|/usr/afsws/bin|/usr/ucb) ;;
  160.     *)
  161.       if test -f $dir/installbsd; then
  162.     INSTALL="$dir/installbsd -c" # OSF1
  163.     INSTALL_PROGRAM='$(INSTALL)'
  164.     INSTALL_DATA='$(INSTALL) -m 644'
  165.     break
  166.       fi
  167.       if test -f $dir/install; then
  168.     if grep dspmsg $dir/install >/dev/null 2>&1; then
  169.       : # AIX
  170.     else
  171.       INSTALL="$dir/install -c"
  172.       INSTALL_PROGRAM='$(INSTALL)'
  173.       INSTALL_DATA='$(INSTALL) -m 644'
  174.       break
  175.     fi
  176.       fi
  177.       ;;
  178.     esac
  179.   done
  180.   IFS="$saveifs"
  181. fi
  182. INSTALL=${INSTALL-cp}
  183. INSTALL_PROGRAM=${INSTALL_PROGRAM-'$(INSTALL)'}
  184. INSTALL_DATA=${INSTALL_DATA-'$(INSTALL)'}
  185.  
  186. if test -n "$prefix"; then
  187.   test -z "$exec_prefix" && exec_prefix='${prefix}'
  188.   prsub="s%^prefix\\([     ]*\\)=\\([     ]*\\).*$%prefix\\1=\\2$prefix%"
  189. fi
  190. if test -n "$exec_prefix"; then
  191.   prsub="$prsub
  192. s%^exec_prefix\\([     ]*\\)=\\([     ]*\\).*$%\
  193. exec_prefix\\1=\\2$exec_prefix%"
  194. fi
  195. DEFS="`echo \"$DEFS\" | sed 's%[&\\\]%\\\&%g'`"
  196.  
  197. trap 'rm -f config.status; exit 1' 1 3 15
  198. echo creating config.status
  199. rm -f config.status
  200. cat > config.status <<EOF
  201. #!/bin/sh
  202. # Generated automatically by configure.
  203. # Run this file to recreate the current configuration.
  204. # This directory was configured as follows,
  205. # on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
  206. #
  207. # $0 $*
  208.  
  209. for arg
  210. do
  211.   case "\$arg" in
  212.     -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
  213.     exec /bin/sh $0 $* ;;
  214.     *) echo "Usage: config.status --recheck" 2>&1; exit 1 ;;
  215.   esac
  216. done
  217.  
  218. trap 'rm -f Makefile; exit 1' 1 3 15
  219. CC='$CC'
  220. INSTALL='$INSTALL'
  221. INSTALL_PROGRAM='$INSTALL_PROGRAM'
  222. INSTALL_DATA='$INSTALL_DATA'
  223. LIBS='$LIBS'
  224. srcdir='$srcdir'
  225. DEFS='$DEFS'
  226. prefix='$prefix'
  227. exec_prefix='$exec_prefix'
  228. prsub='$prsub'
  229. EOF
  230. cat >> config.status <<\EOF
  231.  
  232. top_srcdir=$srcdir
  233. for file in .. Makefile; do if [ "x$file" != "x.." ]; then
  234.   srcdir=$top_srcdir
  235.   # Remove last slash and all that follows it.  Not all systems have dirname.
  236.   dir=`echo $file|sed 's%/[^/][^/]*$%%'`
  237.   if test "$dir" != "$file"; then
  238.     test "$top_srcdir" != . && srcdir=$top_srcdir/$dir
  239.     test ! -d $dir && mkdir $dir
  240.   fi
  241.   echo creating $file
  242.   rm -f $file
  243.   echo "# Generated automatically from `echo $file|sed 's|.*/||'`.in by configure." > $file
  244.   sed -e "
  245. $prsub
  246. s%@CC@%$CC%g
  247. s%@INSTALL@%$INSTALL%g
  248. s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g
  249. s%@INSTALL_DATA@%$INSTALL_DATA%g
  250. s%@LIBS@%$LIBS%g
  251. s%@srcdir@%$srcdir%g
  252. s%@DEFS@%$DEFS%
  253. " $top_srcdir/${file}.in >> $file
  254. fi; done
  255.  
  256. exit 0
  257. EOF
  258. chmod +x config.status
  259. test -n "$no_create" || ./config.status
  260.  
  261.